﻿@namespace Blazorise.Docs.Docs.Examples

<DataGrid @ref="dataGrid"
          TItem="Employee"
          Data="@employeeList"
          Responsive
          Filterable
          FilterMode="DataGridFilterMode.Menu">
     <DataGridColumn Field="@nameof( Employee.FirstName )" Caption="First Name" Editable="false" FilterMethod="DataGridColumnFilterMethod.StartsWith"></DataGridColumn>
    <DataGridColumn Field="@nameof( Employee.LastName )" Caption="Last Name" Editable="false"></DataGridColumn>
    <DataGridSelectColumn TItem="Employee" Field="@nameof( Employee.Gender )" Caption="Gender" Editable Data="EmployeeData.Genders" ValueField="(x) => ((Gender)x).Code" TextField="(x) => ((Gender)x).Description" />
</DataGrid>

@code{
    private DataGrid<Employee> dataGrid;
    private List<Employee> employeeList = new() { new() { FirstName = "David", LastName = "Moreira", Gender = "M" }, new() { FirstName = "MLaden", LastName = "Macanovic", Gender="M" }, new() { FirstName = "John", LastName = "Doe", Gender = "M" }, new() { FirstName = "Ana", LastName = "Chamberlain", Gender = "F" }, new() { FirstName = "Jessica", LastName = "Winston", Gender="F" } };
}